package com.wn.search.controller;

import com.wn.sddfp.common.model.dto.borrow.Pages;
import com.wn.sddfp.common.model.result.Result;
import com.wn.search.model.BorrowRecordIndexVo;
import com.wn.search.model.BorrowRecordSearchQuery;
import com.wn.search.service.SearchService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/search")
public class SearchController {
    
    @Resource
    private SearchService searchService;
    
    @PostMapping("/borrowRecord")
    @ApiOperation("查询借款记录")
    public Result search(@RequestBody BorrowRecordSearchQuery borrowRecordSearchQuery){
        Pages<BorrowRecordIndexVo> pages=
                searchService.search(borrowRecordSearchQuery);
        return Result.ok(pages);
    }

}